#coding=utf-8

from multiprocessing import Process
import os
import time

def subworker(name, seconds):
    print "Process ID# %s" % (os.getpid())
    print "Parent Process ID# %s" % (os.getppid())
    print "%s will sleep for %s seconds" % (name, seconds)
    time.sleep(seconds)

if __name__ == "__main__":
    child_proc = Process(target=subworker, args=('bob', 5))
    child_proc.start()
    time.sleep(1)
    print "This is the parent process"
    print "Parent process abount to join child process"
    child_proc.join()
    print "In parent process after child process join"
    print "The parent's parent process: %s" % (os.getppid())

